package com.luxf.base.domainevent.codec;

import com.google.gson.Gson;

/**
 * gson实现
 *
 * @author fast66
 * 2021-05-27 16:01
 **/
public class GsonMessageEncoder implements MessageEncoder {

    private final Gson gson = new Gson();

    @Override
    public <T> String encode(T message) {
        return gson.toJson(message);
    }
}
